var login = require("../controller/loginController");
var index = require("../controller/indexController");
var menu = require("../controller/menu/menuController");
var util = require("util");
module.exports = function (app) {
    login(app);
    app.get('*', function (req, res, next) {
        var user = req.session.user;
        if(util.isNullOrUndefined(user) || util.isNullOrUndefined(user.username)){
            res.redirect('/');
        }else{
            next();
        }
    });
    index(app);
    menu(app);
};
